package ink.yql.dao;

import ink.yql.model.ProjectUpdate;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProjectUpdateDao {
    @Insert("insert into project_update (pupdateTime,pid,pufrequency,pucontext)values" +
              " (#{pupdateTime} ,#{pid},#{pufrequency} ,#{pucontext} )")
    Integer addOne(ProjectUpdate projectUpdate);

    @Select("SELECT  * FROM  project_update where pid = #{pid} ")
    List<ProjectUpdate> getByPid(@Param("pid") Integer pid);

    @Select("SELECT  max(pufrequency) FROM  project_update where pid = #{pid} ")
    Integer getMaxPufrequencyByPid(@Param("pid") Integer pid);

}
